#include <windows.h>

#include "Tools/FileTools.hpp"
#include "Tools/StringTools.hpp"

#include"ICETask.h"


//#include <entt.hpp>
#include <Remotery.h>

 
osg::Camera *createHUDCamera(double left,
                             double right,
                             double bottom,
                             double top)
{
    osg::ref_ptr<osg::Camera> camera = new osg::Camera;
    camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
    camera->setClearMask(GL_DEPTH_BUFFER_BIT);
    camera->setRenderOrder(osg::Camera::POST_RENDER);
    camera->setAllowEventFocus(false);
    camera->setProjectionMatrix(osg::Matrix::ortho2D(left, right, bottom, top));
    camera->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
    return camera.release();
}



int main()
{
    Remotery* rmt;
	rmt_CreateGlobalInstance(&rmt);

#ifdef WIN32
	/*set current run path*/
	char strPath[MAX_PATH] = {};
	GetModuleFileName(NULL, strPath, MAX_PATH);
	std::string wSoulDir(strPath);
	int n = wSoulDir.rfind('\\');
	wSoulDir.erase(n, wSoulDir.size() - n);
	SetCurrentDirectory(wSoulDir.c_str());
#endif

    dw::ThreadPool thread_pool;
    ICE::OsgTask osgTask;
    osgTask.doTask(&thread_pool);
    thread_pool.wait_for_all();

    rmt_DestroyGlobalInstance(rmt);
    return 0;
}